Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provider/openstack: Safe Security Group Delete #3696

Merged
merged 1 commit into from Oct 30, 2015
Merged

provider/openstack: Safe Security Group Delete #3696

merged 1 commit into from Oct 30, 2015

Conversation

jtopjian
Copy link
Contributor

This commit enables security groups to be deleted in a safe way by
checking their state over a period of time.

This fixes occurrences when the API says the instance is deleted but
it is still in the process of being deleted by OpenStack and thus the
security group returns an error saying that there are still instances
attached to the group.

Fixes #1782

@jtopjian
Copy link
Contributor Author

This passes all current acceptance tests on OpenStack Kilo.

I'll leave this open for a day or so for comments.

@@ -210,10 +212,20 @@ func resourceComputeSecGroupV2Delete(d *schema.ResourceData, meta interface{}) e
return fmt.Errorf("Error creating OpenStack compute client: %s", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noticed this message should be s/creating/deleting/ while reviewing the diff below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, "creating" is correct here - it's making a new OpenStack client connection in order to do the delete. 😄

However, I do have a slightly cleaned up version coming right up.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops! Yes. ☕ ☕ ☕

@phinze
Copy link
Contributor

phinze commented Oct 30, 2015

LGTM

This commit enables security groups to be deleted in a safe way by
checking their state over a period of time.

This fixes occurrences when the API says the instance is deleted but
it is still in the process of being deleted by OpenStack and thus the
security group returns an error saying that there are still instances
attached to the group.
@jtopjian
Copy link
Contributor Author

Just pushed a slightly modified version that adds an additional error check as well as takes advantage of utils.CheckDeleted that I forgot exists.

@phinze
Copy link
Contributor

phinze commented Oct 30, 2015

Solid - looks good. 👍

@jtopjian you can merge - generally we merge with the GitHub button and immediately go to the CHANGELOG and use the in-browser edit to add a line about the change. I usually just copy the title from the PR, paste it into the CHANGELOG, edit it a bit and click save. 🚀

@jtopjian
Copy link
Contributor Author

Awesome! Thanks!

jtopjian added a commit that referenced this pull request Oct 30, 2015
provider/openstack: Safe Security Group Delete
@jtopjian jtopjian merged commit 6ce3b32 into hashicorp:master Oct 30, 2015
omeid pushed a commit to omeid/terraform that referenced this pull request Mar 30, 2018
resource/emr_*: drop custom ValidateFuncs
@ghost
Copy link

ghost commented Apr 30, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@ghost ghost locked and limited conversation to collaborators Apr 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

OpenStack compute_secgroup resources - fails destroy when in use
2 participants